
import axios from 'axios'
//响应拦截器
axios.interceptors.response.use((response) => {
    if (response.data.code === 200) {
        return response.data
    } else if (response.data.code === 400) {
        notification.error({
            message: '错误',
            description: response.data.msg,
            duration: 5
        })
        return
    } else if (response.data.code === 500 || response.data.code === 300 || response.data.code === 302) {
        notification.error({
            message: '错误',
            description: response.data.msg,
            duration: 5
        })
        return
    }
    else {
        return response.data
    }
})


//美食获取
export function getFoodList (url) {
    return axios(url + '/jp/jpTravelDiet/open/list', {
        method: 'get',
    })
}
//住宿获取
export function getLiveList (url) {
    return axios(url + '/jp/jpTravelStay/open/list', {
        method: 'get',
    })
}
//购物场所
export function getPlayList (url) {
    return axios(url + '/jp/jpTravelPlay/open/list', {
        method: 'get',
    })
}
//交通路线
export function getTrafficList (url) {
    return axios(url + '/jp/jpTravelTraffic/open/list', {
        method: 'get',
    })
}


//景点获取
export function getScenicSpotList (url) {
    return axios(url + '/jp/jpScenicSpot/open/list', {
        method: 'get',
    })
}

//文化获取
export function getCultureCustomList (url) {
    return axios(url + '/jp/jpCultureCustom/open/list', {
        method: 'get',
    })
}

//有名人物获取
export function getCultureCelebrityList (url) {
    return axios(url + '/jp/jpCultureCelebrity/open/list', {
        method: 'get',
    })
}
//道路简介
export function getRoadList (url) {
    return axios(url + '/jp/jpRoad/open/list', {
        method: 'get',
    })
}


//西樵山名胜区
export function getOutineAreaList (url) {
    return axios(url + '/jp/jpOutlineArea/open/list', {
        method: 'get',
    })
}


//西樵山概要
export function getOutineList (url) {
    return axios(url + '/jp/jpOutline/open/list', {
        method: 'get',
    })
}
//西樵山游客服务中心
export function getServiceCenterList (url) {
    return axios(url + '/jp/jpServiceCenter/open/list', {
        method: 'get',
    })
}
//轮播图获取
export function getBannerList (url) {
    return axios(url + '/jp/jpHome/open/list', {
        method: 'get',
    })
}

//历史获取
export function getHistoryList (url) {
    return axios(url + '/jp/jpIntoTime/open/list', {
        method: 'get',
    })
}

//720全景获取
export function getPanorama (url) {
    return axios(url + '/jp/jpBeautyPanorama/open/list', {
        method: 'get',
    })
}
//语音获取
export function getAudio (url) {
    return axios(url + '/jp/jpBeautyAudio/open/list', {
        method: 'get',
    })
}
//写真佳作
export function getPhoto (url) {
    return axios(url + '/jp/jpBeautyPhoto/open/list', {
        method: 'get',
    })
}

//视频
export function getVideo (url) {
    return axios(url + '/jp/jpBeautyVideo/open/list', {
        method: 'get',
    })
}


//首页图片
export function getHomePic (url) {
    return axios(url + '/jp/jpHomePic/open/list', {
        method: 'get',
    })
}
